package cn.zwxky.android.staff.BusinessAddList;

import android.content.Context;
import android.view.View;
import android.widget.RelativeLayout;

import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;
import com.zgscwjm.lsfbbasetemplate.utils.valid.Valid;

import java.util.List;

import cn.zwxky.android.staff.R;


/**
 * Created by Administrator on 2017/2/14 0014.
 */

public class FileUploadingAdapter extends CommonRecycAdapter<FileUploadingBean> {
    public FileUploadingAdapter(Context context, List<FileUploadingBean> list, int layoutId) {
        super(context, list, layoutId);
    }

    @Override
    public void convert(ViewHolderRecyc holder, final FileUploadingBean model) {

        holder.setText(R.id.ietm_file_uploading_text_name,model.getName());

        RelativeLayout rl = holder.getView(R.id.ietm_file_uploading);
        if (model.check==true){
           holder.setVisible(R.id.ietm_file_uploading_img,true);
        }else if (model.check==false){
            holder.setVisible(R.id.ietm_file_uploading_img,false);
        }

        holder.setOnclick(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                    FileClickEvent event = new FileClickEvent();
                    event.setData(model.getNumber());
                    LsfbEvent.getInstantiation().post(event);
            }
        });

    }
}
